body {
  margin: 0;
  padding: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica,
    Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  font-size: 14px;
}

h3 {
  text-transform: capitalize;
}

.app-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
}

.app-content {
  height: 100vh;
  overflow: hidden;
}

.app-grid-layout {
  height: 100%;
  display: flex;

  .ant-row {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
  }
}

.app-panel {
  height: 100%;
  background-color: #fff;
  border-radius: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s;
  overflow: hidden;

  &:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
  }

  &.left-panel {
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  &.right-panel {
    border-radius: 0;
    flex: 1;
    overflow: hidden;
    box-shadow: -4px 0px 20px 0px #0000000a;
  }
}

.panel-content {
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;

  &.left-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;

    .playground-panel-header {
      flex-shrink: 0;
      height: 60px;
      padding: 0 24px 0 24px;
      border-bottom: rgba(0, 0, 0, 0.06) solid 1px;
      display: flex;
      align-items: center;

      .header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
      }

      h2 {
        margin: 0 0 16px 0;
        font-size: 18px;
        font-weight: 600;
        color: #1890ff;
      }
    }

    .playground-panel-playground {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: 0;
      padding: 0 24px 0 24px;

      .playground-container {
        flex: 1;
        background: white;
        border: 1px solid #0000001f;
        border-radius: 8px;
        overflow: hidden;
        border: none;
      }
    }
  }

  &.right-panel-content {
    border-radius: 0;
    padding: 0 24px 24px 24px;
  }
}

// Server offline container
.server-offline-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;

  .server-offline-message {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f2f4f7;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 14px 24px 0 24px;

    .server-offline-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: center;
      text-align: center;
      padding-top: 20vh;
    }

    .server-offline-icon {
      position: relative;
      display: inline-block;

      .icon-background,
      .icon-foreground {
        display: block;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
      }

      .icon-background {
        width: 300px;
        height: 212px;
        z-index: 1;
      }

      .icon-foreground {
        width: 134px;
        height: 101px;
        z-index: 2;
      }

      // Container to maintain aspect ratio
      &::after {
        content: '';
        display: block;
        width: 300px;
        height: 212px;
        position: relative;
      }
    }

    h1 {
      font-size: 18px;
      font-weight: 600;
      letter-spacing: 0%;
      color: #000;
      margin: 0;
    }
    .connection-status {
      font-size: 12px;
      letter-spacing: 0%;
      text-align: center;
      margin-top: 8px;
    }
  }
}

// Screenshot viewer styles
.screenshot-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;

  &.offline,
  &.loading,
  &.error {
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #666;

    .screenshot-placeholder {
      h3 {
        font-size: 18px;
        margin-bottom: 12px;
        color: #1890ff;
        text-transform: capitalize;
      }

      p {
        color: #666;
        margin: 0;

        &.error-message {
          color: #ff4d4f;
        }
      }
    }
  }

  .screenshot-header {
    justify-content: space-between;
    align-items: center;
    display: flex;
    height: 56px;

    .screenshot-title {
      display: flex;
      flex-direction: column;
      gap: 4px;

      h3 {
        margin: 0;
        font-size: 14px;
        color: #000;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
        text-transform: capitalize;

        &::before {
          content: '';
          width: 24px;
          height: 24px;
          background-image: url('./icons/device.svg');
          background-size: contain;
          background-repeat: no-repeat;
          background-position: center;
        }
      }

      .screenshot-subtitle {
        font-size: 12px;
        color: #999;
        margin: 0;
      }
    }
  }

  .screenshot-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f2f4f7;
    border-radius: 16px;
    padding: 0 15px;

    .screenshot-overlay {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      padding: 12px 5px 8px 5px;
      z-index: 10;

      .device-name-overlay {
        color: rgba(0, 0, 0, 0.85);
        font-size: 12px;
        font-weight: 500;
        text-transform: capitalize;
        display: flex;
        align-items: center;
        gap: 8px;

        .info-icon {
          font-size: 12px;
          opacity: 0.8;
          cursor: pointer;

          &:hover {
            opacity: 1;
          }
        }
      }

      .screenshot-controls {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 18px;
        border-radius: 4px;
        opacity: 1;
        padding: 4px 8px;
        box-sizing: border-box;

        .last-update-time {
          font-size: 12px;
          color: #666;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        .operation-indicator {
          display: flex;
          align-items: center;
          gap: 4px;
          font-size: 12px;
        }

        .ant-btn {
          border: none;
          box-shadow: none;
          background: transparent;
          padding: 0;
          width: 16px;
          height: 16px;
          min-width: 16px;
          display: flex;
          align-items: center;
          justify-content: center;

          &:hover {
            background-color: rgba(0, 0, 0, 0.06);
            border-radius: 2px;
            transform: scale(1.1);
            transition: all 0.2s ease;
          }

          .anticon {
            font-size: 12px;
            color: #666;
            transition: color 0.2s ease;
          }

          &:hover .anticon {
          }
        }
      }
    }

    .screenshot-content {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 0;

      .screenshot-image {
        max-width: 100%;
        max-height: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 12px;
      }

      .screenshot-placeholder {
        text-align: center;
        color: #999;
      }
    }
  }
}

// PanelResizeHandle styles
.panel-resize-handle {
  background-color: #f0f0f0;
  transition: background-color 0.2s;
  position: relative;

  &.horizontal {
    width: 1px;
    cursor: col-resize;
  }

  &.vertical {
    height: 1px;
    cursor: row-resize;
  }

  &:hover {
    background-color: #1677ff;
  }

  &:active {
    background-color: #1677ff;
  }

  &[data-resize-handle-active] {
    background-color: #1677ff;
  }
}

.clear-button-container {
  top: 20px !important;
  right: -4px !important;
}
